package com.stylefeng.guns.common.persistence.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author stylefeng123
 * @since 2018-02-05
 */
@TableName("lg_book")
public class Book extends Model<Book> {

    private static final long serialVersionUID = 1L;

    private Integer id;
    /**
     * 名称
     */
    @Length(min = 1, max = 100, message = "项目名称字数必须在1到100之间")
    @NotBlank(message="项目名称不能为空")
    private String name;
    /**
     * 排序
     */
    @Range(min = 0, max = 2147483647, message = "排序必须在0到2147483647之间")
    @NotNull(message="排序不能为空")
    private Integer sort;
    /**
     * 备注
     */
    @Length(max = 1000, message = "备注字数不能大于1000")
    private String remarks;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Book{" +
        "id=" + id +
        ", name=" + name +
        ", sort=" + sort +
        ", remarks=" + remarks +
        "}";
    }
}
